Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new Markdown query documentation page for the SSMM operational dashboard question covering daily month-to-date (through yesterday) IP bed occupancy, OP encounters, and Emergency encounters.
Changes:
- Added
Care/Encounter/ip_op_emer_encounter_count_ssmm.mddocumenting the dashboard purpose, date window, and SQL query. - Implemented SQL CTEs to generate a day series, compute daily occupied beds, and aggregate OP/Emergency volumes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+89
to
+91
|
|
||
|
|
||
| ````` |
amjithtitus09
requested changes
Jun 8, 2026
| AND fl.parent_id NOT IN (19, 44) | ||
| AND fle.deleted = FALSE | ||
| AND fle.start_datetime::date <= d.report_date | ||
| AND (fle.end_datetime IS NULL OR fle.end_datetime::date > d.report_date) |
Member
There was a problem hiding this comment.
If discharge_date is same as report_date, should bed be counted as occupying for that day or no?
| FROM emr_facilitylocationencounter fle | ||
| INNER JOIN emr_facilitylocation fl ON fle.location_id = fl.id | ||
| INNER JOIN emr_encounter e ON fle.encounter_id = e.id | ||
| WHERE fl.deleted = FALSE |
Member
There was a problem hiding this comment.
Missed filtering out deleted encounters?
| @@ -0,0 +1,91 @@ | |||
|
|
|||
| # IP / OP / Emergency Encounter Count - SSMM | |||
Member
There was a problem hiding this comment.
Encounter count or Patient count? Since you're doingDISTINCT patient_id
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://data-public.ssmmhospital.com/question/186-ip-op-emergency-encounters